/* db.workmate.find(
        {"skill.skillOne":"HTML+CSS"},
        {name:true,"skill.skillOne":true,_id:false}
    ) */

// 不等符号查询
 /*    db.workmate.find(
        {age:{$lte:30,$gte:25}},
        {name:1,"skill.skillOne":1,age:1,_id:0}
        ) */
//日期查找
/* var startDate=new Date('01/01/2018');
db.workmate.find(
    {regeditTime:{$gt:startDate}},
    {name:true,age:true,"skill.skillOne":true,_id:false}
    ) */

    // 多条件查询
// $nin
//$in
   /*  db.workmate.find(
        {age:{$in:[25,33,30]}},
        {name:1,"skill.skillOne":1,age:1,_id:0}
        ) */

       /*  db.workmate.find(
            {age:{$nin:[25,33,30]}},
            {name:1,"skill.skillOne":1,age:1,_id:0}
            ) */

    //$or
/*     db.workmate.find({$or:[
        {age:{$gte:30}},
        {'skill.skillThree':'PHP'}
    ]},
    {name:1,'skill.skillThree':1,age:1,_id:0}
    ) */

    //$not
/*     db.workmate.find({
        age:{
            $not:{
                $lte:30,
                $gte:20
            }
        }
    },
    {name:1,'skill.skillThree':1,age:1,_id:0}
    ) */


    // all  相当与and 符号
    /* db.workmate.find({interest:['画画','聚会','看电影']},
    {name:true,interest:true,age:true,_id:false}
    ) */

  /*   db.workmate.find({interest:{$all:['看电影','看书']}},
    {name:true,interest:true,age:true,_id:false}
    ) */

    // $in 修饰符
    db.workmate.find({interest:{$in:['看电影','看书']}},
    {name:true,interest:true,age:true,_id:false}
    )

        // $size 修饰符

        db.workmate.find({interest:{$size:5}},
        {name:true,interest:true,age:true,_id:false}
        )

           // $slice 修饰符  显示多少项  -1 表示最后一项
           db.workmate.find({interest:{$size:3}},
            {name:true,interest:{$slice:2},age:true,_id:false}
            )

//分页参数  显示2 年龄从小到大
db.workmate.find(
    {},
    {name:true,age:true,_id:false}
    ).limit(6).skip(0).sort({age:1})

//修饰符 $where  查询年龄大于30 岁的程序员~
db.workmate.find(
    {$where:"this.age>30"},
    {name:true,age:true,_id:false}
    )



